package com.example.client.handlers;

import com.example.common.util.Resp;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @Author: 582895699@qq.com
 * @Desctription: TODO
 * @Date: Created in 2021/11/28 23:05
 */
@Slf4j
@ChannelHandler.Sharable
@Component
public class ClientHandler extends SimpleChannelInboundHandler<Resp> {

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, Resp msg) throws Exception {
        Channel channel = ctx.channel();
        log.info("[{}]收到服务器端响应；msg:{}", channel.id(), msg.toString());
    }
}
